{extend name="common:frm_base" /}
{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">添加订单</div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="{:url('Order/handle1')}" lay-filter="component-form-group">
                <div class="layui-form-item">
                    <label class="layui-form-label">开始城市</label>
                    <div class="layui-input-block">
                        <select name="start_city">
                            <option value="香港">香港</option>
                            {foreach $city as $key=>$val}
                            <option value="{$val.name}">{$val.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">终点城市</label>
                    <div class="layui-input-block">
                        <select name="end_city">
                            {foreach $city as $key=>$val}
                            <option value="{$val.name}">{$val.name}</option>
                            {/foreach}
                            <option value="香港">香港</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">出发日期</label>
                    <div class="layui-input-block">
                        <input type="text" id="use_time" name="use_time" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">上车地点</label>
                    <div class="layui-input-block">
                        <input type="text"  name="site" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">人数</label>
                    <div class="layui-input-block">
                        <input type="text"  name="number" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系人</label>
                    <div class="layui-input-block">
                        <input type="text"  name="realname" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-block">
                        <input type="text"  name="mobile" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否返程</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="status" lay-skin="switch" value="1" lay-text="ON|OFF">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">返程日期</label>
                    <div class="layui-input-block">
                        <input type="text" id="back_time" name="back_time" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">返程上车地点</label>
                    <div class="layui-input-block">
                        <input type="text"  name="back_site" placeholder="请输入" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea  class="layui-input" name="remark"></textarea>
                    </div>
                </div>
                <input type="hidden" value="{$act}" name="act" />
                <input type="hidden" value="{$info['id']|default=''}" name="id" />
                <div class="layui-form-item layui-hide">
                    <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
                </div>
                <!--<div class="layui-form-item layui-layout-admin">-->
                <!--<div class="layui-input-block">-->
                <!--<div class="layui-footer" style="left: 0;">-->
                <!--<button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>-->
                <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
                <!--</div>-->
                <!--</div>-->
                <!--</div>-->
            </form>
        </div>
    </div>
</div>


<script>
    layui.config({
        base: '__LAYUIADMIN__/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'laydate', 'upload'], function () {
        var $ = layui.$
            , form = layui.form
            ,upload = layui.upload
            , table = layui.table;
        var laydate = layui.laydate;

        laydate.render({
            elem: '#use_time'
            ,type: 'datetime'
        });

        laydate.render({
            elem: '#back_time'
            ,type: 'datetime'
        });

        form.render(null, 'component-form-group');

        var uploadInst = upload.render({
            elem: '#bus_img_btn'
            , url: "{:url('common/upload_img')}"
            , data: {name:'ad'}
            , accept: 'images'
            , acceptMime: 'image/*,image/gif'
            , done: function (res) {
                $('#bus_img_btn').attr('src',res.data.img);
                $('#logo').val(res.data.img);
            }
            , error: function () {
            }
        });

    });
</script>
</body>
</html>
{/block}